@model IList<ProductDetailsModel.ProductVariantModel.TierPriceModel>
@using Nop.Web.Models.Catalog;
@using Nop.Core.Domain.Customers;

@{
    var displayTierPrices = false;
    var currentTierPrice = (ProductDetailsModel.ProductVariantModel.TierPriceModel)ViewBag.CurrentTierPrice;
    var regularTierPrice = (ProductDetailsModel.ProductVariantModel.TierPriceModel)ViewBag.RegularPrice;
    ProductDetailsModel.ProductVariantModel.TierPriceModel memberTierPrice = null;
    bool isCurrentTierPrice = false;
    if (Model.Count > 0)
    {
        displayTierPrices = true;
        memberTierPrice = Model.First();
    }

    if (!currentTierPrice.TierSystemName.Equals(regularTierPrice.TierSystemName))
    {
        isCurrentTierPrice = true;
        memberTierPrice = currentTierPrice;
    }
}
<div class="tier-pricing-container col-xs-12 col-sm-8 col-md-6 col-lg-4">
    @if (isCurrentTierPrice)
    { 
    <div class="tier-pricing-table text-center member-tier">
        <div class="price-tier member">
            <div class="tier-name">Member</div>
            <div class="tier-price">@memberTierPrice.Price</div>
        </div>
        <div class="price-tier regular">
            <div class="tier-name">Regular</div>
            <div class="tier-price">@Html.Raw((ViewBag.RegularPrice as ProductDetailsModel.ProductVariantModel.TierPriceModel).Price)</div>
        </div>
    </div>
    }
    else
    { 
    <div class="tier-pricing-table text-center">
        <div class="price-tier regular">
            <div class="tier-name">Regular</div>
            <div class="tier-price">@Html.Raw((ViewBag.RegularPrice as ProductDetailsModel.ProductVariantModel.TierPriceModel).Price)</div>
        </div>
        @if (displayTierPrices)
        {
            <div class="price-tier member">
                <div class="tier-name">Member</div>
                <div class="tier-price">@memberTierPrice.Price</div>
            </div>
        }
            
    </div>
    }
    <div class="clear"></div>
</div>